package com.od.controller;

import com.od.entity.Resume;
import com.od.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("resume")
@CrossOrigin
public class ResumeController {
    @Autowired
    private ResumeService resumeService;

    @RequestMapping("getStrengthById")
    @ResponseBody
    public String getStrengthById(int resumeSeeker) {
        return resumeService.getStrengthById(resumeSeeker);
    }

    @RequestMapping("addResume")
    @ResponseBody
    public int insertResume(Resume resume) {
        return resumeService.insertResume(resume);
    }

    @RequestMapping("updateResumeById")
    @ResponseBody
    public int updateResumeById(@RequestBody Resume resume) {
        System.out.println(resume);
        return resumeService.updateResumeById(resume);
    }

}
